package cheme.ProcessEditor.Figures;

import org.eclipse.draw2d.BendpointConnectionRouter;
import org.eclipse.draw2d.Graphics;
import org.eclipse.swt.SWT;

import cheme.ProcessEditor.ChemePresentation;
import cheme.ProcessEditor.Figures.Util.ChemePolylineConnection;

/**
 * Renders a chemical stream as a standard GEF connection with antialiasing turned on.
 * @author Jonathan
 *
 */
public class StreamFig extends ChemePolylineConnection
{
	public StreamFig()
	{
		super();
		setConnectionRouter(new BendpointConnectionRouter());
		
		super.setLineWidth(0);
		super.setForegroundColor(ChemePresentation.Streams.defaultStreamForeground);
	}
		
	@Override
	public void paintFigure(Graphics graphics)
	{
		graphics.pushState();
			graphics.setAntialias(SWT.ON);
			super.paintFigure(graphics);
		graphics.popState();
	}
}
